cmake_minimum_required(VERSION 3.10)
project(libusb_example)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_VERBOSE_MAKEFILE ON)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBUSB REQUIRED libusb-1.0)

include_directories(${LIBUSB_INCLUDE_DIRS})
link_directories(${LIBUSB_LIBRARY_DIRS})

add_executable(libusb_example main.c)

target_link_libraries(libusb_example ${LIBUSB_LIBRARIES})

# 添加编译选项
target_compile_options(libusb_example PRIVATE ${LIBUSB_CFLAGS_OTHER})
